<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>各项目一周告警情况</title>
    <link rel="stylesheet" href="css/index.css" />
    <link rel="stylesheet" href="../plugin/layui/css/layui.css"/>
    <style>
        .content{
            padding: 5px;
        }
        section{
            color: rgb(51, 255, 255);
            text-align: center;
            line-height: 50px;
        }
        .layui-table,.layui-table thead tr,.layui-table-header{
            background: transparent;
            color:#e6e6e6;
            border-color:rgb(51, 255, 255);
        }
        .layui-table td, .layui-table th, .layui-table-col-set, .layui-table-fixed-r, .layui-table-grid-down, .layui-table-header, .layui-table-page, .layui-table-tips-main, .layui-table-tool, .layui-table-total, .layui-table-view, .layui-table[lay-skin=line], .layui-table[lay-skin=row]{
            border-color:rgb(51, 255, 255);
        }
        .layui-table tbody tr:hover,.layui-table-hover{
            background-color: #01AAED;
        }
    </style>
</head>
<body>

<div style="width: 98%;margin: 0 auto;">
    <section><h2>近一周告警情况</h2></section>
    <table id="workOrder" ></table>
</div>
<script src="../../../../js/common.js"></script>
<script src="../../../../js/component.js"></script>
<script src="../js/jquery-2.1.1.min.js"></script>
<script src="../plugin/layui/layui.js"></script>
<script>
    var h = document.body.offsetHeight;
    layui.use('table',function(){
        var table = layui.table;

            table.render({
                elem:"#workOrder",
                headers: {
                    uid: SiteConfig.account.uId,
                    token:SiteConfig.account.accessToken
                } //如果无需传递额外参数，可不加该参数
                ,
                url: SiteConfig.webApi+ 'Error/List',
                method: 'post' //如果无需自定义HTTP类型，可不加该参数
                ,
                request: {
                    pageName: 'pageno' //页码的参数名称，默认：page
                    ,
                    limitName: 'pagesize' //每页数据量的参数名，默认：limit
                }, //如果无需自定义请求参数，可不加该参数
                response: {
                    statusName: 'state' //数据状态的字段名称，默认：code
                    ,
                    msgName: 'errMsg' //状态信息的字段名称，默认：msg
                    ,
                    countName: 'total' //数据总数的字段名称，默认：count
                } ,//如果无需自定义数据响应名称，可不加该参数
                where:{ProcessFlag:-1,LogType:-1,UserId:SiteConfig.account.id},
                height:h-140,
                page:true,
                cols:[[
                    {field:'ProjectName',title:'项目名称'},
                    {field:'DevName',title:'设备名称',align:'center'},
                    {field:'DeviceNo',title:'设备编码',align:'center'},
                    {field:'installAddress',title:'设备地址',align:'center'},
                    {field:'ErrorName',title:'告警名称',align:'center'},
                    {field:'LogDate',title:'发生时间',align:'center'},
                    {field:'ProcessFlag',title:'当前状态',align:'center',templet:function (d) {
                            if(d.ProcessFlag == 0) return '<span class="layui-badge-dot layui-bg-cyan"></span>&nbsp;未派单'
                            else if(d.ProcessFlag == 1) return '<span class="layui-badge-dot"></span>&nbsp;已派单'
                            else return '<span class="layui-badge-dot layui-bg-green"></span>&nbsp;处理完成'
                        }}
                ]],
            })


    })
</script>
</body>
</html>
